﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace motelmanagement.useInterface
{
    public partial class LoginControls : DevComponents.DotNetBar.Controls.SlidePanel
    {
        public LoginControls()
        {
            InitializeComponent();
        }
        protected override void OnResize(EventArgs e)
        {
            // Center the panel
            metroTilePanel1.Location = new Point((this.Width - metroTilePanel1.Width) / 2 + 16);//, ((this.Height - labelX1.Height - 16) - metroTilePanel1.Height) / 2 + labelX1.Height + 16);
            base.OnResize(e);
        }
        private MetroBillCommands _Commands;
        public MetroBillCommands Commands
        {
            get { return _Commands; }
            set
            {
                if (value != _Commands)
                {
                    MetroBillCommands oldValue = _Commands;
                    _Commands = value;
                    OnCommandsChanged(oldValue, value);
                }
            }
        }
        private void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
        {
            if (newValue != null)
            {
                metroTileItem1.Command = newValue.ClientCommands.New;
            }
            else
            {
                metroTileItem1.Command = null;
            }
        }
        private void buttonX1_Click(object sender, EventArgs e)
        {
            this.IsOpen = false;
            this.SlideOutButtonVisible = false;
        }
    }
}
